<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>自定义参考系</title>
    <script include="jquery" src="./static/libs/include-lib-local.js"></script>
    <script include="proj4" src="./static/libs/include-leaflet-local.js"></script>
    <style>
        #map {
            height: 800px
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script>
        //高斯3带投影
        var crs = new L.Proj.CRS('EPSG:2362',
                '+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs', {
                    resolutions: [
                        35.07833000659791, 17.539165003298955, 8.769582501649477,
                        4.384791250824739, 2.1923956254123693, 1.0961978127061847
                    ],
                    origin: [38570106.6565339, 4107440.9868805557],
                    bounds: L.bounds([
                        [38570106.6565339, 4100174.3296849937],
                        [38576679.186042026, 4107440.9868805557]
                    ])
                }),


            map = L.map('map', {
                crs: crs,
                center: [37.09, 114.80], //注意这里要使用经纬度坐标
                zoom: 2,
                continuousWorld: true,
                worldCopyJump: false,
            });

        var { protocol, ip, port } = window.webclient;
        //创建地图文档图层
        var mapDocLayer = new Zondy.Map.MapTileLayer("高斯坐标", {
            //IP地址
            ip: `${ip}`,
            //端口号
            port: `${port}`,
            //只显示一个图层,不平铺显示
            noWrap: true
        }).addTo(map);
    </script>
</body>

</html>
